package cn.csc.module.pay.controller.app.jzb;

import cn.csc.framework.common.pojo.CommonResult;
import cn.csc.framework.common.pojo.PageResult;
import cn.csc.framework.jzb.vo.JzbResponse;
import cn.csc.framework.security.core.annotations.PreAuthenticated;
import cn.csc.module.pay.controller.admin.drawcash.vo.PayDrawCashPageReqVO;
import cn.csc.module.pay.controller.admin.funddetailsinfo.vo.PayFundDetailsInfoPageReqVO;
import cn.csc.module.pay.controller.app.jzb.vo.PayFundDetailsReqVO;
import cn.csc.module.pay.controller.app.jzb.vo.SmallAmountTransferQueryReqVO;
import cn.csc.module.pay.convert.funddetailsinfo.PayFundDetailsInfoConvert;
import cn.csc.module.pay.dal.dataobject.drawcash.PayDrawCashDO;
import cn.csc.module.pay.dal.dataobject.funddetailsinfo.PayFundDetailsInfoDO;
import cn.csc.module.pay.dal.dataobject.funddetailslog.PayFundDetailsLogDO;
import cn.csc.module.pay.service.drawcash.PayDrawCashService;
import cn.csc.module.pay.service.funddetailsinfo.PayFundDetailsInfoService;
import cn.csc.module.pay.service.funddetailslog.PayFundDetailsLogService;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import oracle.jdbc.proxy.annotation.Pre;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.annotation.security.PermitAll;

import static cn.csc.framework.common.pojo.CommonResult.success;

/**
 * @Author：云隐
 * @Date：2023/7/10 18:31
 */
@Api(tags = "用户 APP - 见证宝业务")
@RestController
@RequestMapping("/pay/mem")
@Validated
@Slf4j
@Setter
public class AppPayFundDetailsController {

    @Resource
    private PayFundDetailsInfoService payFundDetailsInfoService;
    @Resource
    private PayDrawCashService payDrawCashService;

    @PostMapping("/fundQuery")
    @ApiOperation(value = "资金进出记录")
    @PreAuthenticated
    public CommonResult<PageResult> fundQuery(
            @Validated @RequestBody PayFundDetailsInfoPageReqVO reqVO) {
        PageResult<PayFundDetailsInfoDO> pageResult = payFundDetailsInfoService.getFundDetailsInfoPage(reqVO);
        return success(PayFundDetailsInfoConvert.INSTANCE.convertPage(pageResult));
    }

}
